package cn.tnar.cloud.parkservice.feign.fallback;

import cn.tnar.cloud.parkservice.feign.AcctMemberInfoFeign;
import cn.tnar.cloud.parkservice.util.ResultJson;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年04月09日 11:49:19
 */
@Component
public class AcctMemberInfoFeignFallBackFactory implements FallbackFactory<AcctMemberInfoFeign> {

    @Override
    public AcctMemberInfoFeign create(Throwable throwable) {
        return new AcctMemberInfoFeign() {
            @Override
            public String index() {
                return "用户服务";
            }

            @Override
            public ResultJson getById(Long id) {
                return ResultJson.getInstance().setCode(400).setData(null).setMsg("parkInfo-feign-getById服务熔断");
            }
        };
    }
}
